/**
 * 
 */
package easyservice.application;

import junit.framework.TestCase;
import mockapp.SampleClientApp;
import mockapp.SampleClientAppImpl;
import mockapp.SampleServerApp;
import mockapp.SampleServerListener;

/**
 * @author Rodrigo
 *
 */
public class ClientTest extends TestCase {
	
	public void test() {
		SampleClientApp c1 = new SampleClientAppImpl();
		ClientAgentImpl<SampleServerApp, SampleServerListener> clientAgent1 = new ClientAgentImpl<SampleServerApp, SampleServerListener>("client1", "client1", "zezinho", 5222, "server1@zezinho", SampleServerApp.class, c1);
		
		SampleServerApp proxyApp = (SampleServerApp) clientAgent1.getFacade();
		
		assertNotNull(proxyApp);
		try {
			proxyApp.method1();
		} catch (Throwable e) {
			fail(e.getMessage());
		}
		assertTrue(proxyApp.method2() == 'c');
		assertEquals("string", proxyApp.method3());
		assertTrue(proxyApp.method4() == 25);
		assertTrue(proxyApp.method5() == 25);
		assertTrue(proxyApp.method6() == 25.0f);
		assertTrue(proxyApp.method7() == 25.0d);
		
		assertNull(proxyApp.method8());
	}

}
